﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using log4net;
using log4net.Repository.Hierarchy;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace NETCORE.Log4Net2.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TestController : ControllerBase
    {
        private ILog log;

        public TestController()
        {
            this.log = LogManager.GetLogger(Startup.loggerRepository.Name,typeof(TestController));
        }


        [Route("Get1")]
        [HttpGet]
        public IActionResult Get1()
        {
            this.log.Error("这里出现了一个错误");

            return new JsonResult(new { aaa="哈哈,test！"});
        }

    }
}
